VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form frmDelUser 
   BackColor       =   &H00800000&
   BorderStyle     =   1  'Fixed Single
   Caption         =   " "
   ClientHeight    =   3105
   ClientLeft      =   3255
   ClientTop       =   2520
   ClientWidth     =   5235
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   3105
   ScaleWidth      =   5235
   Begin VB.Frame Frame1 
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      Caption         =   "Frame1"
      Height          =   1560
      Left            =   195
      TabIndex        =   2
      Top             =   840
      Width           =   4920
      Begin MSDataListLib.DataCombo cbouser 
         Bindings        =   "frmDelUser.frx":0000
         Height          =   315
         Left            =   2175
         TabIndex        =   3
         Top             =   135
         Width           =   1905
         _ExtentX        =   3360
         _ExtentY        =   556
         _Version        =   393216
         ListField       =   "UserName"
         BoundColumn     =   "userName"
         Text            =   ""
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   330
         Left            =   150
         Top             =   1080
         Visible         =   0   'False
         Width           =   1875
         _ExtentX        =   3307
         _ExtentY        =   582
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   8
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   ""
         OLEDBString     =   ""
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   ""
         Caption         =   "Adodc1"
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         _Version        =   393216
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "Staff Name"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   300
         Index           =   2
         Left            =   735
         TabIndex        =   7
         Top             =   690
         Width           =   1125
      End
      Begin VB.Label lblName 
         BackStyle       =   0  'Transparent
         DataField       =   "Name"
         DataSource      =   "Adodc1"
         BeginProperty Font 
            Name            =   "VNI-Times"
            Size            =   9
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   300
         Left            =   2130
         TabIndex        =   5
         Top             =   720
         Width           =   2715
      End
      Begin VB.Label lbl 
         BackStyle       =   0  'Transparent
         Caption         =   "User Name"
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   300
         Index           =   1
         Left            =   795
         TabIndex        =   4
         Top             =   225
         Width           =   1125
      End
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "&Exit"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   345
      Left            =   2820
      TabIndex        =   1
      Top             =   2520
      Width           =   1155
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "&Delete"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   345
      Left            =   1020
      TabIndex        =   0
      Top             =   2535
      Width           =   1155
   End
   Begin VB.Label lbl 
      BackStyle       =   0  'Transparent
      Caption         =   "Delete User"
      BeginProperty Font 
         Name            =   "VNI-Present"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   450
      Index           =   0
      Left            =   75
      TabIndex        =   6
      Top             =   15
      Width           =   2370
   End
End
Attribute VB_Name = "frmDelUser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Activate()
Adodc1.ConnectionString = ConnectString
Adodc1.CommandTimeout = 10
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "Select Users.* from Users WHERE (((Users.UserName)<>'' And (Users.UserName) Is Not Null))"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset.MoveFirst
    cbouser.Text = Adodc1.Recordset("UserName")
    lblName.Caption = Adodc1.Recordset("Name")
End If
End Sub

Private Sub cmdDelete_Click()
   
Set cmdExecute = New ADODB.Command
Set cmdExecute.ActiveConnection = DBconn
cmdExecute.CommandText = ("UPDATE Users SET UserGroup = 0 " & _
            " , UserName='' , password =''" & _
            " WHERE UserName='" & cbouser.Text & "'")
cmdExecute.Execute

Adodc1.Refresh
cbouser.ReFill
If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset.MoveFirst
    lblName.Caption = Adodc1.Recordset("Name")
    cbouser.Text = Adodc1.Recordset("UserName")
End If

End Sub

Private Sub cmdExit_Click()
    Unload frmDelUser
  
End Sub



Private Sub cbouser_Click(Area As Integer)
If Area = 2 Then
    With Adodc1.Recordset
        .MoveFirst
        Do Until !UserName = cbouser.Text
            .MoveNext
        Loop
    End With
    lblName.Caption = Adodc1.Recordset("Name")
    
End If
End Sub
